package pro.cherish.knowledgeumldesignpattern.designPattern.com.cherish.builder;

public class CherishAirShipDirector implements AirShipDirector {
    private AirShipBuilder builder;
    public CherishAirShipDirector(AirShipBuilder builder){
        this.builder=builder;
    }
    @Override
    public AirShip createAirShip() {
        Engine engine = builder.buildEngine();
        OrbitalModel orbitalModel = builder.buildOrbitalModel();
        EsCape esCape = builder.buildEsCape();
        AirShip ship=new AirShip();
        ship.setEngine(engine);
        ship.setEscapeTower(esCape);
        ship.setOrbitaMOdule(orbitalModel);
        return ship;
    }
}
